package tech.aistar.corejava.day14;

import java.io.*;

/**
 * Created by 豆梦寒 on 2019/8/2.
 */
public class FileCopyDemo {
    public static void main(String[] args) {
        //JDK7.0语法糖
        //声明在try中的资源，释放的权限交给了jvm；
        try(BufferedReader br = new BufferedReader(new FileReader("src/tech/aistar/corejava/day14/IODemo01.java"));
        PrintWriter out = new PrintWriter(new FileWriter("src/tech/aistar/corejava/day14/IODemo01.java"))){
            while (true){
                String line = br.readLine();

                if (line == null) {
                    break;
                }
                System.out.println(line);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
